<template>
	<view class="mainpadding">
		<u-swiper :list="list1" keyName="image_text" height="160" indicator circular @click="lbtclick($event,list1)"></u-swiper>
		<view class="flexleft margin_top">
			<view class="ggline margin_right2"></view>
			<view class=" titletext fonweight zhonghei">推荐路线</view>
		</view>
		<view class="flexbetween flex_wrap ">
			<view class="spbox margin_top" v-for="item in list.data" :key="item.id"
				@click="jumpdetail('/pages/index/godetail?id=',item.id)">
				<image class="sptp" :src="item.image_text" mode=""></image>
				<view class="" style="padding: 30rpx 15rpx;">
					<view class="ershiba xiaohei yhxk">{{item.name}}</view>
					<view class="ershiba xiaolan margin_top2 yhxk">￥{{item.price}}</view>
					<!-- <view class="strongtext xiaohui yhxk margin_top2">{{item.content}}</view> -->
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				list1: [
					// "http://test-1314461322.cos.ap-guangzhou.myqcloud.com/2024/11/05/fac4f269c3d84a21aa200e1826900e6b.jpg"
				],
				page: 1,
				limit: 12,
				list: {
					data: []
				},
			}
		},
		onLoad() {
			this.getbanner()
			this.init()
		},
		methods: {
			init(isPage, page) {
				let _this = this
				httpRequest.request('/api/Travelcl/touristIndex', 'GET', {
					page: page || 1,
					limit: 12,
					dmkj_category_id: this.tabsid
				}).then(res => {
					uni.stopPullDownRefresh()
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							this.list = res.data
							_this.list.data = resList.data;
						}
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
			getbanner() { //获取轮播图
				httpRequest.request('/api/index/getAdvertiseList', 'POST', {
					advertise_position_id: 2,
					is_more: 1
				}).then(res => {
					this.list1 = res.data
				}).catch(err => {})
			},
		}
	}
</script>

<style scoped>
	.ggline {
		width: 8rpx;
		height: 33rpx;
		border-radius: 23rpx;
		background-color: #3478f5;
	}

	.spbox {
		width: 48%;
	}

	.sptp {
		width: 100%;
		height: 338rpx;
		border-radius: 11rpx 11rpx 0 0;
	}

	.spbox {
		background: #FFFFFF;
		border-radius: 11rpx 11rpx 11rpx 11rpx;
	}
</style>